<template>
	<view class="view" >
		<textarea class="textarea"  placeholder="请输入标题"placeholder-class="placeholder" />
		<textarea class="textarea2" placeholder="请输入内容" auto-height="true"/>
		
		<view class="imglsit">
			<image :src="item" v-for="item in imglsit"></image>
			<view class="add" @tap="add">
				<image src="../../static/icon/add.png" mode=""></image>
				<text>添加图片</text>
			</view>
		</view>
		
		
		<view class="tab_l" @tap="huatshow">
			<text>所属话题</text>
			<text>{{huati}}</text>
			<image src="../../static/icon/jiantou.png" mode=""></image>
		</view>
		<view class="tab_l">
			<text>添加标签</text>
			<image src="../../static/icon/jiantou.png" mode=""></image>
		</view>
		
		<view class="bottom">
			<text>取消</text>
			<text>发布</text>
		</view>
		
		<view class="huatilist" :class="huatim?'huatilistshow':''">
			<text class="b" @tap="huatim = false"></text>
			<view class="v1">
				<view class="header">
					<text>所属话题</text>
					<image src="../../static/icon/colos2.png" mode="" @tap="huatim = false"></image>
				</view>
				<view class="list">
					<text @tap="huattap(item)" :class="item == huati ? 'newt' : ''" v-for="item in huatilist">{{item}}</text>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				imglsit:[],
				huati:'',
				huatilist:['情感','家庭教育','学习辅导','人际关系','专注力','情绪','测试','其他'],
				huatim:false
			}
		},
		methods: {
			add(){
				uni.chooseImage({
					success: (e) => {
						console.log(e)
						this.imglsit = this.imglsit.concat(e.tempFilePaths);
					}
				})
			},
			huattap(item){
				this.huati = this.huati == item ? '' : item;
			},
			huatshow(){
				this.huatim = this.huatim ? false : true;
			}
		}
	}
</script>

<style>
	.view{
		padding: 20rpx 48rpx;
		display: flex;
		flex-direction: column;
		flex: 1;
	}
	*{
		font-family: PingFangSC-Semibold, PingFang SC;
	}
	.huatilist .list{
		display: flex;
		flex-direction: row;
		flex-wrap: wrap;
		margin-top: 48rpx;
	}
	.huatilist .list>text{
		background: #F7F7F7;
		border-radius: 40rpx;
		width: 216rpx;
		height: 80rpx;
		display: block;
		text-align: center;
		line-height: 80rpx;
		font-size: 14px;
		margin-right: 10rpx;
		margin-bottom: 32rpx;
	}
	.huatilist .list .newt{
		background: linear-gradient(90deg, #F99333 0%, #F15F35 100%);
		color: #FFFFFF;
	}
	.huatilist .v1{
		background-color: #FFFFFF;
		border-radius: 32rpx 32rpx 0px 0px;
		padding: 32rpx;
		width: 750rpx;
		transition: transform .3s ease;
		transform: translateY(100%);
	}
	.huatilistshow .v1{
		transform: translateY(0);
	}
	.huatilist .header{
		display: flex;
		flex-direction: row;
		align-items: center;
		
	}
	.huatilist .header>text{
		font-size: 16px;
		font-weight: 600;
		opacity: .8;
		display: flex;
		flex: 1;
	}
	.huatilist .header>image{
		width: 28rpx;
		height: 28rpx;
	}
	.huatilist{
		position: fixed;
		top: 0;
		left: 0;
		bottom: 0;
		right: 0;
		z-index: -1;
		display: flex;
		align-items: flex-end;
		transition: z-index .3s ease;
	}
	.huatilistshow{
		z-index: 99;
	}
	.huatilistshow .b{
		opacity: 1 !important;
	}
	.huatilist .b{
		position: absolute;
		left: 0;
		right: 0;
		bottom: 0;
		top: 0;
		background-color: rgba(0,0,0,.3);
		z-index: -1;
		opacity: 0;
		transition: opacity .3s ease;
	}
	.bottom{
		position: fixed;
		bottom: 0;
		left: 0;
		right: 0;
		background: #FFFFFF;
		box-shadow: 0px -4rpx 30rpx 0rpx rgba(0, 0, 0, 0.05);
		display: flex;
		justify-content: space-around;
	}
	.bottom>text{
		width: 336rpx;
		height: 80rpx;
		display: block;
		text-align: center;
		line-height: 80rpx;
		border: 2rpx solid #F15E35;
		border-radius: 40rpx;
		margin: 22rpx 0;
		color: #F25F36;
		font-size: 16px;
	}
	.bottom>text:nth-child(2){
		background: linear-gradient(90deg, #F99333 0%, #F15F35 100%);
		color: #FFFFFF;
		border: none;
		width: 338rpx;
		height: 82rpx;
	}
	.tab_l{
		display: flex;
		flex-direction: row;
		align-items: center;
		height: 118rpx;
		border-bottom: 1rpx solid rgba(0,0,0,.1);
	}
	.tab_l>text:nth-child(1){
		font-size: 18px;
		opacity: .8;
		display: flex;
		flex: 1;
	}
	.tab_l>text:nth-child(2){
		font-size: 18px;
		font-weight: 600;
		color: #F15F35;
		margin-right: 10rpx;
	}
	.tab_l>image{
		width: 18rpx;
		height: 32rpx;
	}
	.imglsit{
		margin-top: 48rpx;
		display: flex;
		flex-direction: row;
		flex-wrap: wrap;
		border-bottom: 1rpx solid rgba(0,0,0,.1);
		padding-bottom: 64rpx;
	}
	.imglsit>image{
		width: 208rpx;
		height: 208rpx;
		border-radius: 16rpx;
		margin-right: 10rpx;
	}
	.add{
		width: 208rpx;
		height: 208rpx;
		background: #F7F7F7;
		border-radius: 16rpx;
		display: flex;
		align-items: center;
		justify-content: center;
		flex-direction: column;
	}
	.add>image{
		width: 56rpx;
		height: 56rpx;
		display: block;
		margin-bottom: 12rpx;
	}
	.add>text{
		font-size: 12px;
		opacity: .6;
	}
	.textarea{
		height: 130rpx;
		border-bottom: 1rpx solid rgba(0,0,0,.1);
		font-size: 20px;
		font-weight: 600;
		line-height: 56rpx;
		position: relative;
	}
	.placeholder{
		position: absolute;
		top: 0;
		bottom: 0;
		line-height: 130rpx;
	}
	.textarea2{
		min-height: 180rpx;
		margin-top: 40rpx;
		font-size: 16px;
	}
</style>
